// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 资产类型枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2024-10-28
 */
public enum AssetsCategoryTypeEnum {
    HOUSING_EQUIPMENT(1, "房屋设备"),
    PRODUCTION_MACHINE(2, "生产机器"),
    NON_PRODUCTION_MACHINE(3, "非生产设备"),
    OFFICE_EQUIPMENT(4, "办公设备/非电脑"),
    COMPUTER(5, "个人电脑"),
    COURTYARD(6, "院落/场地"),
    MOLD_TOOL(7, "模具/工具"),
    SOFTWARE(8, "软件"),
    NEW_BUILDING(9, "新建筑"),
    RENOVATION_HOUSES(10, "房屋装修");

    private int value;

    private String name;

    AssetsCategoryTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        AssetsCategoryTypeEnum arrObj[] = AssetsCategoryTypeEnum.values();
        for (AssetsCategoryTypeEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }

    public static int getValueByName(String name) {
        AssetsCategoryTypeEnum arrObj[] = AssetsCategoryTypeEnum.values();
        for (AssetsCategoryTypeEnum obj : arrObj) {
            if (StringUtils.equals(name, obj.getName())) {
                return obj.getValue();
            }
        }
        return 0;
    }
}
